{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "892b4168",
   "metadata": {},
   "outputs": [],
   "source": [
    "# notebook 使用教程"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8a445a9f",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 当前路径\n",
    "!pwd\n",
    "%pwd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "0ef0dbc5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 3 µs, sys: 0 ns, total: 3 µs\n",
      "Wall time: 8.11 µs\n"
     ]
    }
   ],
   "source": [
    "# 单行代码性能\n",
    "import time\n",
    "\n",
    "def sleep(s):\n",
    "    time.sleep(s)\n",
    "    pass\n",
    "\n",
    "%time\n",
    "sleep(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "c342a10a",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 863 µs, sys: 1.57 ms, total: 2.43 ms\n",
      "Wall time: 2.01 s\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "# 当前代码单元性能\n",
    "import time\n",
    "time.sleep(2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d54563ec",
   "metadata": {},
   "outputs": [],
   "source": [
    "%%timeit\n",
    "# 当前代码单元性能\n",
    "import time\n",
    "time.sleep(2)\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
